//==========================================================================================//
//A fun??o abaixo exibe em um layer especifico um texto de ajuda hint a fun??o mais abaixo
//limpa o layer
function ShowInfo(whattoshow) {
	var InfoFrame = top.document.getElementById("INFO").contentWindow;
	InfoFrame.document.getElementById("infoContents").innerHTML = whattoshow.split("|")[1];
	InfoFrame.document.getElementById("infoTitle").innerHTML = whattoshow.split("|")[0];
	//fade in
}

function HideInfo() {
	var InfoFrame = top.document.getElementById("INFO").contentWindow;
	//fade out
	InfoFrame.document.getElementById("infoContents").innerHTML = "";
	InfoFrame.document.getElementById("infoTitle").innerHTML = "";
}
//==========================================================================================//
//Esta fun??o retorna o valor de um determinado styleSheet
function getCssValue(StyleSheetTitle,SelectorName,RuleName,Default){
	var index;

	var StyleSheetIndex = -1;
	var MyStyleSheets = document.styleSheets;
	for (index = 0; index < MyStyleSheets.length; index++) {
		if (MyStyleSheets[index].title == StyleSheetTitle) {
			StyleSheetIndex = index;
			break;
		}
	}
	//O CSS n?o existe
	if (StyleSheetIndex == -1) {
		return Default;
	}

	if (document.all) {
		var RuleIndex = -1;
		var MyRules = MyStyleSheets[StyleSheetIndex].rules;
		for (index = 0; index < MyRules.length; index++) {
			if (MyRules[index].selectorText == SelectorName) {
				var RuleIndex = index;
				break;
			}
		}
		//A regra n?o existe
		if (RuleIndex == -1) {
			return Default;
		}

		return eval("document.styleSheets["+StyleSheetIndex+"].rules["+RuleIndex+"].style."+RuleName);
	} else {
		var RuleIndex = -1;
		var MyRules = MyStyleSheets[StyleSheetIndex].cssRules;
		for (index = 0; index < MyRules.length; index++) {
			if (MyRules[index].selectorText == SelectorName) {
				var RuleIndex = index;
				break;
			}
		}
		//A regra n?o existe
		if (RuleIndex == -1) {
			return Default;
		}

		return eval("document.styleSheets["+StyleSheetIndex+"].cssRules["+RuleIndex+"].style."+RuleName);
	}
}
//==========================================================================================//
//A fun??o abaixo tem prop?sito de debug, ela gera um bloco HTML contendo todas as
//propriedades DOM do objeto passado como par?metro
function getDOMProperties(DOMObject){
	var MyObject = eval(DOMObject);
	var Properties = "<div style=\"font-size: 12px; font-family: Helvetica; color: #FFFFFF; background-color: #000000; border: 2px ridge white;\">\n";
	Properties += "<h3 style=\"text-align: center; font-weight: bold; color: #FFFFFF;\">Exibindo o conte?do de " + DOMObject + "</h3>\n";
	Properties += "<h5 style=\"text-align: center; font-weight: bold; color: #FFFFFF;\">O objeto acima foi interpretado como " + MyObject + "</h5><br>";
	Properties += "<ul>";
	var PropertyValue;
	for (var propName in MyObject) {

		if ((propName == "innerHTML") || (propName == "outerHTML")) {
			Properties += "<li>" + propName + ": <a href=\"#\" style=\"color: yellow; font-weight: bold; font-style: italic\" onclick=\"void(0)\">Exibir...</a></li>\n";
			continue;
		}

		PropertyValue = ""+MyObject[propName]+"";

		if (PropertyValue.indexOf("[object") != -1) {
			Properties += "<li>" + propName + ": <a href=\"#\" style=\"color: yellow; font-weight: bold; font-style: italic\" onclick=\"void(0)\">" + PropertyValue + "</a></li>\n";
		} else {
			Properties += "<li>" + propName + ": <span style=\"color: green; font-weight: bold; font-style: italic\">" + PropertyValue + "</span></li>\n";
		}
	}
	Properties += "</ul></div>";
	return Properties;
}

/*
Exemplo de uso do GetDOMProperties

		<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
        <!--
			function faca() {
				obj = document.getElementById("countervalue");
    	        document.write(getDOMProperties("obj"));
			}
			faca();
        //-->
        </SCRIPT>

*/